package com.example.video.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface StarDao {
    //收藏
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(starEntity: StarEntity)

    //取消收藏
    @Delete
    fun delete(starEntity: StarEntity)

    //查询是否收藏了
    @Query("select * from star where id = :id")
    fun queryById(id:Int):MutableList<StarEntity>

    //查询所有
    @Query("select * from star")
    fun query():MutableList<StarEntity>
}